<template>
  <div class="app-container">
    <!-- 医院信息 -->
    <h5 class="titleInfo">订单基础信息</h5>
    <el-form ref="list" :inline="true" :model="list" label-width="130px">
      <el-row>
        <el-col :span="12">
          <el-form-item label="订单号">
            <span class="spanToInput">{{list.order_sn | filterNull}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="服务名称">
            <span class="spanToInput">{{list.service_name | filterNull}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="商品名称">
            <span class="spanToInput">{{list.shop_name | filterNull}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="昵称">
            <span class="spanToInput">{{list.nickname | filterNull}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="姓名">
            <span class="spanToInput">{{list.realname | filterNull}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="手机号">
            <span class="spanToInput">{{list.phone | filterNull}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="用户类型">
            <span class="spanToInput">{{list.customer_type| filterNull}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="下单时间">
            <span class="spanToInput">{{list.created_at | filterNull}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="订单状态">
            <span class="spanToInput">{{list.order_status_name | filterNull}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="核销时间">
            <span class="spanToInput">{{list.appointment_time | filterNull}}</span>
          </el-form-item>
        </el-col>
      </el-row>
    <!-- 汇款单回款信息 -->
    <div class="divBar"></div>
    <h5 class="titleInfo">订单交易信息</h5>
     <el-row>
        <el-col :span="12">
          <el-form-item label="订单应付金额">
            <span class="spanToInput">{{list.order_price | filterNull}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="会员优惠金额">
            <span class="spanToInput">{{list.member_discount | filterNull}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="抵扣积分">
            <span class="spanToInput">{{list.deduction_credit | filterNull}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="优惠券金额">
            <span class="spanToInput">{{list.ticket_total| filterNull}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="订单支付金额">
            <span class="spanToInput">{{list.order_amount | filterNull}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="支付方式">
            <span class="spanToInput">{{list.payment_name | filterNull}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="支付流水号">
            <span class="spanToInput">{{list.out_trade_no | filterNull}}</span>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="支付时间">
            <span class="spanToInput">{{list.pay_time | filterNull}}</span>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
   
  </div>
</template>
<script>
import {orderInfo} from "@/api/orderMange";

export default {
  data() {
    return {
      id: "",
      list: {}
    };
  },
  filters: {
    filterNull(e) {
      if (!e) {
        return "暂无";
      } else {
        return e;
      }
    },
  },
  created() {
    this.id = String(this.$route.query.id);
    // this.orderSn = this.$route.query.orderSn;
  },
  mounted() {
    this.getList();
  },
  methods: {
    getList() {
      orderInfo({
        id: this.id
      })
        .then(res => {
          console.log(res);
          if (res.data.code == 200) {
            this.list = res.data.data;
          } else {
            this.$message.error(res.data.msg);
          }
        })
        .catch(error => {
          this.$message.error(error);
        });
    }
  }
};
</script>

<style scoped>
.app-container {
  padding: 0px !important;
}
.form {
  margin-left: 268px;
}
</style>